home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / TEST / HELLO_WO.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  2.1 KB  |  60 lines

  1.  
  2. /* -----------------------------------------------------------------------
  3.  * The "Hello World" applet.  This is a very simple applet that puts up
  4.  * a button, which when pressed destroys itself (since we can't really exit
  5.  * an applet per se).
  6.  * -----------------------------------------------------------------------
  7.  */
  8.  
  9. package sub_arctic.test;
  10.  
  11. /* import various pieces of the sub_arctic toolkit that we need */
  12. import sub_arctic.lib.*;
  13. import sub_arctic.input.*;
  14. import sub_arctic.constraints.std_function;
  15.  
  16. /* We use a new subclass of interactor_applet (which is an applet capable of 
  17.  * hosting a sub_arctic interface).
  18.  */
  19. public class hello_world_debug extends debug_interactor_applet 
  20.   implements callback_object {
  21.  
  22.   /* initialization of sub_arctic interface when applet starts */
  23.   public void build_ui(base_parent_interactor top) 
  24.     {
  25.       /* create a button centered in the top level interactor */
  26.       button goodbye = new button("Goodbye", this);
  27.       goodbye.set_x_constraint(std_function.centered(PARENT.W(), 0));
  28.       goodbye.set_y_constraint(std_function.centered(PARENT.H(), 0));
  29.  
  30.       /* make the button a child of the top level */
  31.       top.add_child(goodbye);
  32.  
  33.     }
  34.  
  35.   /* handle callback from the button. */
  36.   public void callback(interactor from, event evt, int cb_num, Object cb_parm)
  37.     {
  38.       /* remove the button from the interface (since we can't exit) */
  39.       if (from.parent() != null)
  40.         from.parent().remove_child(from);
  41.     }
  42. };
  43.  
  44. /*=========================== COPYRIGHT NOTICE ===========================
  45.  
  46. This file is part of the subArctic user interface toolkit.
  47.  
  48. Copyright (c) 1996 Scott Hudson and Ian Smith
  49. All rights reserved.
  50.  
  51. The subArctic system is freely available for most uses under the terms
  52. and conditions described in 
  53.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  54. and appearing in full in the lib/interactor.java source file.
  55.  
  56. The current release and additional information about this software can be 
  57. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  58.  
  59. ========================================================================*/
  60.